package com.sanchunhui.psc.service.impl

import com.sanchunhui.psc.data.protocol.BaseResp
import com.sanchunhui.psc.data.protocol.ResponseInfo
import com.sanchunhui.psc.data.protocol.TokenReq
import com.sanchunhui.psc.data.respository.UploadRepository
import com.sanchunhui.psc.ext.convert
import com.sanchunhui.psc.service.UploadService
import okhttp3.MultipartBody
import okhttp3.RequestBody
import org.json.JSONObject
import rx.Observable
import javax.inject.Inject

/*
    上传业务实现类
 */
class UploadServiceImpl @Inject constructor(): UploadService {

    @Inject
    lateinit var repository: UploadRepository

    override fun getUploadToken(): Observable<String> {
       return repository.getUploadToken().convert()
    }

    override fun uploadUserHead(
        token: RequestBody,
        file: MultipartBody.Part
    ): Observable<ResponseInfo> {
        return repository.uploadUserHead(token,file)
    }



}
